import { createStore, combineReducers, applyMiddleware, compose } from 'redux';
import ReduxThunk from 'redux-thunk';
import ReduxPromise from 'redux-promise';

import CityReducer from './reducer/CityReducer';
import CinemaReducer from './reducer/CinemaReducer';
import TabbarReducer from './reducer/TabbarReducer';

const reducer = combineReducers({
  CityReducer,
  TabbarReducer,
  CinemaReducer,
});

const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;

const store = createStore(
  reducer,
  composeEnhancers(applyMiddleware(ReduxThunk, ReduxPromise))
);

export default store;
